After you add a field to a form, you can use an expression to calculate the value of the field at run time. For example, you can associate the Total Time field with an expression that adds together individual values, such as hours and minutes, or generates a subtotal from a list of time sheets.
To calculate the value of a field:
Open a case type in Case Designer.
On the Life cycle tab, click an assignment or an approval step.
Click Configure view.
Set the display mode of a field to Calculated (read-only).
Not all field types support this display mode.
Click the Gear icon to open the Calculation dialog box.
Define a calculation by calling a function, referencing properties in an expression, or creating an advanced expression.
Follow these steps when the field stores a numeric value, such as an integer or decimal.
Select an option in the Function list.
For example, you can calculate an average or find a maximum value.
In the Field list, select a single-value field that is defined in a repeating field group.
Click Submit.
In the Function list, select Custom.
In the smart prompt field, enter an expression without quotation marks that uses property names, functions, dot notation, and mathematical symbols.
Press the Down Arrow key to see which properties you can reference.
Click Submit.
In the smart prompt field, enter an expression without quotation marks that uses property names, functions, dot notation, and mathematical symbols.
Press the Down Arrow key to see which properties you can reference.
Click Submit.
Click Open.
Configure the Declare Expression form by defining a list of properties and their expected values.
Click Save.
Close the Declare Expression form and return to the Calculation dialog box.
Click Cancel.
Click Submit.
At run time, the field is displayed in read-only mode. Your application evaluates the expression and stores the results in the property that is associated with the field.